//
//  NetWorkHelper.h
//  test
//
//  Created by mac on 2017/8/31.
//  Copyright © 2017年 mac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <PGNetworkHelper/PGNetworkHelper.h>

@interface NetWorkHelper : NSObject

- (instancetype)initWithUrl:(NSString *)url;
//get请求，不需要缓存
-(void)GET:(NSString *)url completion:(void (^)(BOOL success,NSDictionary *data))callback;
//get请求，自动缓存
-(void)GET:(NSString *)url cacheKey:(NSString *)cacheKey completion:(void (^)(BOOL success,NSDictionary *data))callback;
//post请求，不需要缓存
-(void)POST:(NSString *)url params:(NSDictionary *)params completion:(void (^)(BOOL success,NSDictionary *data))callback;
//post请求，自动缓存
-(void)POST:(NSString *)url cacheKey:(NSString *)cacheKey params:(NSDictionary *)params compile:(void (^)(BOOL success,NSDictionary *data))callback;
//取消所有请求
-(void)cancelAllOperations;
//删除指定key的缓存
-(void)removeKeyCache:(NSString *)key;
//删除所有的缓存
-(void)removeAllCache;
//下载文件
-(void)downloadFile:(NSString *)URL fileDir:(NSString *)fileDir;
//上传文件
-(void)uploadFile:(NSString *)URL parameters:(NSDictionary *)parameters images:(NSArray<UIImage *> *)images name:(NSString *)name mimeType:(NSString *)mimeType;

@end
